Script: --on windowEvent wdID,wdName,objNo,objName,objValue¬Global gImportFields, gAvailableImportFields¬global gWindowPositions, gYears, gReplaceAllImportIssues¬global serialNum¬¬---------------------¬-- This is window #12¬---------------------¬¬if objValue="Open" then¬ -- Restore old window position¬ put OldWindowPosition(12) into windowRect¬ if windowRect = empty then centerWindow wdName¬ else wsSet wdID,"0","Rect",windowRect¬ ¬ wsSet wdID,"0","IdleDelay", "30"¬ ¬ if serialNum = empty then wsSet wdID,11,"Disabled","True"¬ else wsSet wdID,11,"Disabled","False"¬ ¬ -- Match up the actual years to the period fields¬ set the itemDelimiter to " " -- Option space¬ repeat with x = 1 to the number of lines of gYears¬ put line x of gYears into yearToMatch¬ ¬ put false into foundIt¬ repeat with listIndex = 1 to the number of lines of gImportFields¬ -- look in the importfields list¬ if item 1 of line listIndex of gImportFields = "Value-Year " & x then¬ delete item 2 of line listIndex of gImportFields¬ put " (" & yearToMatch & ")" after line listIndex of gImportFields¬ put true into foundIt¬ end if¬ end repeat¬ ¬ if not foundIt then¬ repeat with listIndex = 1 to the number of lines of gAvailableImportFields¬ if item 1 of line listIndex of gAvailableImportFields = "Value-Year " & x then¬ delete item 2 of line listIndex of gAvailableImportFields¬ put " (" & yearToMatch & ")" after line listIndex of gAvailableImportFields¬ end if¬ end repeat¬ end if¬ end repeat¬ ¬ ¬ wsSet wdID,"7","Name", "Move >>"¬ wsSet wdID,"ImportOrder","Text", gImportFields¬ wsSet wdID,"AvailableForImport","Text", gAvailableImportFields¬ if gAvailableImportFields ≠ empty then¬ wsSet wdID,"AvailableForImport","Selection", "1"¬ wsSet wdID,"7","Disabled", "False"¬ else¬ wsSet wdID,"AvailableForImport","Selection", "0"¬ wsSet wdID,"7","Disabled", "True"¬ end if¬ wsSet wdID,"LinesToSkip","Selection","0,99"¬ wsSet wdID,15,Hilite,gReplaceAllImportIssues¬ wsSet wdID,16,Hilite,(not gReplaceAllImportIssues)¬ ¬else if objValue="Close" then ¬ -- save the window position¬ put "12" & tab & wdName & tab & wsGet(wdID,"0","Rect") into line 12 of gWindowPositions¬ ¬else if objValue="Idle" then ¬ put wsGet("Import Price List",11,"Name") into theOldName¬ if the optionKey is down then¬ if theOldName <> "Import…" then ¬ wsSet "Import Price List","11","Name", "Import…"¬ end if¬ else ¬ if theOldName <> "Import" then¬ wsSet "Import Price List","11","Name", "Import"¬ end if¬ end if¬end if¬¬--end windowEvent¬
Balloon: This is a list of all fields in the ComicBase which can be imported. Select a field here, then click “Move >>” to add it to the list which will be imported.
Balloon: This is the list of fields which are to be imported. The order shown corresponds to the order which they will be expected in each record of your import file.
Script: --on mouseUp wdID,wdName,objNo,objName,objValue¬get wsGet(wdID,"ImportOrder","SelectionText")¬if it ≠ empty then¬ if it ≠ "< Blank Field >" then¬ wsSet wdID,"7","Name", "<< Move"¬ else¬ wsSet wdID,"7","Name", "Remove"¬ end if¬ ¬ wsSet wdID,"7","Disabled", "False"¬end if¬¬--end mouseUp
ItemType: POP
Rect: 101,219,174,232
TextFont: Geneva
TextSize: 9
Name: ItemSeparator
Text: Tab¬Space¬Return¬-¬Other…
TitleItem: 4
Balloon: This is the character which is used to separate different fields of a given issue. For most programs, “Tab” is used to separate fields.
Script: --on mouseUp wdID,wdName,objNo,objName,objValue¬if objValue = "Other…" then¬ get windowScript("Other Separator")¬ if it <> empty then¬ put mapCharsToCharNames (NumToChar(line 2 of it)) into temp¬ wsSet "Import Price List","ItemSeparator","selectionText",temp¬ else¬ wsSet "Import Price List","ItemSeparator","SelectionText", "Tab"¬ end if¬end if¬--end mouseUp
ItemType: LBL
Rect: 11,218,102,230
TextFont: Geneva
TextSize: 9
TextStyle: Bold
WhiteColor: -8739,-8739,-8739
Text: Item Separator:
ItemType: POP
Rect: 370,219,443,232
TextFont: Geneva
TextSize: 9
Name: RecordSeparator
Text: Tab¬Space¬Return¬-¬Other…
TitleItem: 6
Balloon: This is the character which is used to separate different records (issues) in the file you are importing. For most programs, a “Return” character is used to separate records.
Script: --on mouseUp wdID,wdName,objNo,objName,objValue¬if objValue = "Other…" then¬ get windowScript("Other Separator")¬ if it <> empty then¬ put mapCharsToCharNames (NumToChar(line 2 of it)) into temp¬ wsSet "Import Price List","RecordSeparator","selectionText",temp¬ else¬ wsSet "Import Price List","RecordSeparator","SelectionText", "Return"¬ end if¬end if¬¬--end mouseUp
ItemType: LBL
Rect: 266,219,370,231
TextFont: Geneva
TextSize: 9
TextStyle: Bold
WhiteColor: -8739,-8739,-8739
Text: Record Separator:
ItemType: PUSH
Rect: 173,31,277,51
AutoSize: FALSE
Name: Move >>
DefaultItem: TRUE
Balloon: If the name of this button is “Move >>”, clicking here will add the selected field to the list of fields which are to be imported. ¬¬If the name is “<< Move”, clicking here will remove the selected field from the list of fields to be imported.
Script: --on mouseUp wdID,wdName,objNo,objName,objValue¬global serialNum¬¬if objName = "Move >>" then¬ put wsGet(wdID,"AvailableForImport","Text") into origListText¬ put wsGet(wdID,"AvailableForImport","Selection") into ImportSelectLine¬ put line importSelectLine of origListText into theSelectedItem¬ if theSelectedItem ≠ empty then¬ put wsGet(wdID,"ImportOrder","Text") into importList¬ delete line (ImportSelectLine) of origListText¬ wsSet wdID,"AvailableForImport","Text",origListText¬ ¬ if importList = empty then¬ wsSet wdID,"ImportOrder","Text", (theSelectedItem)¬ else¬ wsSet wdID,"ImportOrder","Text", (importList & return & theSelectedItem)¬ end if¬ ¬ if (line ImportSelectLine of origListText <> "") then¬ wsSet wdID, "AvailableForImport","Selection",importSelectLine¬ else -- No selection left (at end of list, etc.)¬ if importSelectLine > 1 then¬ wsSet wdID, "AvailableForImport","Selection",importSelectLine - 1¬ else -- nothing left in list¬ wsSet wdID, 7,"Disabled",True¬ end if¬ end if¬ ¬ if serialNum <> empty then wsSet wdID,11,"Disabled", "False"¬ end if¬ ¬else -- Move back to original list¬ put wsGet(wdID,"ImportOrder","Selection") into theSelectedLine¬ put wsGet(wdID,"ImportOrder","Text") into importList¬ put line theSelectedLine of importList into theSelectedItem¬ ¬ if theSelectedItem ≠ empty then¬ put wsGet(wdID,"AvailableForImport","Text") into origListText¬ delete line (theSelectedLine) of importList¬ wsSet wdID,"ImportOrder","Text", importList¬ if theSelectedItem <> "< Blank Field >" then¬ put the number of lines of origListText into numAvailLines¬ if numAvailLines > 0 then¬ put return & theSelectedItem after origListText¬ else¬ put theSelectedItem after origListText ¬ end if¬ wsSet wdID,"AvailableForImport","Text",origListText¬ end if ¬ ¬ if word 1 of line theSelectedLine of importList <> "" then¬ wsSet wdID, "ImportOrder","Selection",theSelectedLine¬ else¬ if theSelectedLine > 1 then ¬ wsSet wdID, "ImportOrder","Selection",theSelectedLine - 1¬ else -- nothing left in list¬ wsSet wdID, 7,"Disabled",True¬ end if¬ end if¬ end if¬ ¬ if importList = empty then¬ wsSet wdID,11,"Disabled", "True"¬ end if¬end if¬--end mouseUp¬
ItemType: LBL
Rect: 266,239,417,251
TextFont: Geneva
TextSize: 9
TextStyle: Bold
WhiteColor: -8739,-8739,-8739
Text: Lines to Skip at Beginning:
ItemType: TEXT
Rect: 414,237,442,253
TextFont: Geneva
TextSize: 9
Name: LinesToSkip
LockText: FALSE
Text: 0
Balloon: Enter the number of lines which should be skipped over at the top of the import file before beginning the import. This is useful if there is heading information at the top of the file which is not part of the data.
ItemType: PUSH
Rect: 173,188,277,208
AutoSize: FALSE
Name: Cancel
CancelItem: TRUE
AutoClose: TRUE
Balloon: Click here to cancel without importing a file.
ItemType: PUSH
Rect: 173,136,277,156
AutoSize: FALSE
Disabled: TRUE
Name: Import
Balloon: Click here to begin importing your file.
ItemType: PUSH
Rect: 173,63,277,83
Name: Add Blank >>
Balloon: Click here to add a blank in between fields. This is useful if you are importing a file which contains fields (columns) which are not listed in the list of fields which can be imported. Then, these fields are simply skipped over.
Script: --on mouseUp wdID,wdName,objNo,objName,objValue¬global serialNum¬¬put "< Blank Field >" into theSelectedItem¬put wsGet(wdID,"AvailableForImport","Selection") into importSelectedItem¬¬put wsGet(wdID,"ImportOrder","Text") into importList¬¬if importList = empty then put (theSelectedItem) into importList¬else put return & theSelectedItem after importList¬¬wsSet wdID,"ImportOrder","Text", (importList)¬get "AvailableForImport_Selection:" & importSelectedItem & return ¬if serialNum <> empty then put "i11_Disabled:False" & return after it¬wsSet wdName,"Properties",it¬--end mouseUp
ItemType: LBL
Rect: 16,14,166,26
TextFont: Geneva
TextSize: 9
TextStyle: Bold
AutoSize: FALSE
WhiteColor: -8739,-8739,-8739
Text: Available Fields
ItemType: LBL
Rect: 301,13,377,25
TextFont: Geneva
TextSize: 9
TextStyle: Bold
WhiteColor: -8739,-8739,-8739
Text: Import Fields
ItemType: RAD
Rect: 11,239,235,251
TextFont: Geneva
TextSize: 9
WhiteColor: -8739,-8739,-8739
Name: Replace all issues of imported titles (faster)
ItemType: RAD
Rect: 11,254,199,266
TextFont: Geneva
TextSize: 9
WhiteColor: -8739,-8739,-8739
Name: Replace only matching or new issues
Hilite: TRUE
ItemType: PUSH
Rect: 173,162,277,182
AutoSize: FALSE
Name: Show Preview
Balloon: Click here to begin importing your file.
Script: --on mouseUp wdID,wdName,objNo,objName,objValue¬global importFileName, gImportWasDisabled, gMoveWasDisabled¬¬if objName = "Show Preview" then¬ put wsGet(wdID,"ImportOrder","Text") into gImportFields¬ ¬ put wsGet(wdID,"ItemSeparator","TextOfSelection") into itemDelimiterCharName¬ put wsGet(wdID,"RecordSeparator","TextOfSelection") into recDelimiterCharName¬ put wsGet(wdID,"LinesToSkip","Text") into skipLines¬ put mapCharNamestoChars(itemDelimiterCharName) into itemDelimiterChar¬ put mapCharNamestoChars(recDelimiterCharName) into recDelimiterChar¬ open file importFileName¬ repeat with x = 1 to skipLines¬ read from file importFileName until recDelimiterChar¬ end repeat¬ read from file importFileName until recDelimiterChar¬ close file importFileName¬ ¬ put xlate(it,itemDelimiterChar,return) into theList¬ ¬ -- put wsGet(wdID,"11","Disabled") into gImportWasDisabled¬ put wsGet(wdID,"7","Disabled") into gMoveWasDisabled¬ ¬ wsSet wdID,"AvailableForImport","Visible", "False"¬ wsSet wdID,"PreviewFields","Visible", "True"¬ wsSet wdID,"PreviewFields","Text", theList¬ wsSet wdID,objNo,"Name", "Hide Preview"¬ wsSet wdID,"13","Name", "Preview of 1st record"¬ -- wsSet wdID,"11","Disabled", true¬ wsSet wdID,"7","Disabled", true¬ ¬else¬ wsSet wdID,"AvailableForImport","Visible", "True"¬ wsSet wdID,"13","Name", "Available Fields"¬ wsSet wdID,"PreviewFields","Visible", "False"¬ wsSet wdID,objNo,"Name", "Show Preview"¬ -- wsSet wdID,"11","Disabled", gImportWasDisabled¬ wsSet wdID,"7","Disabled", gMoveWasDisabled¬end if¬¬--end mouseUp
ItemType: LIST
Rect: 11,27,155,209
TextFont: Geneva
TextSize: 9
Visible: FALSE
Name: PreviewFields
Logic: Drag
DoubleClickItem: 7
Text:
Balloon: This is a list of all fields in the ComicBase which can be imported. Select a field here, then click “Move >>” to add it to the list which will be imported.